package org.uoss.applications.framework.dao.jpa.hibernate.impl;

import org.hibernate.Session;
import org.uoss.applications.framework.dao.jpa.generic.impl.GenericDAOImpl;
import org.uoss.applications.framework.dao.jpa.hibernate.HibernateDAO;
import org.uoss.applications.framework.entity.GeneralObject;
import org.uoss.core.exception.UOSSException;

public class HibernateDAOImpl<T extends GeneralObject> extends GenericDAOImpl<T> implements HibernateDAO<T> {

	public Session getSession() throws UOSSException {
		Session session = ((Session) this.em.getDelegate());
		if (session == null || !session.isOpen()) {
			//throw new BusinessException(UOSSErrorCode.DEFAULTEXCEPTION, "Session is closed.");
		}
		return session;
	}
}
